﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:utlimate="clr-namespace:UltimatePlugin.UI">
    <utlimate:IntToStringConverter x:Key="intToStringConverter"/>

    <Style x:Key="LinkButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <TextBlock TextDecorations="Underline">
                        <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Blue" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="Slider" TargetType="{x:Type Slider}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="35"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Slider Grid.Row="1"
                    Value="{Binding Value, RelativeSource={RelativeSource TemplatedParent}}"
                    Delay="{TemplateBinding Delay}"
                    Interval="{TemplateBinding Interval}"
                    IsEnabled="{TemplateBinding IsEnabled}"
                    LargeChange="{TemplateBinding LargeChange}"
                    Orientation="{TemplateBinding Orientation}"
                    SmallChange="{TemplateBinding SmallChange}"
                    TickFrequency="{TemplateBinding TickFrequency}"
                    TickPlacement="{TemplateBinding TickPlacement}"
                    Ticks="{TemplateBinding Ticks}"
                    ToolTip="{TemplateBinding ToolTip}"
                    Maximum="{TemplateBinding Maximum}"
                    Minimum="{TemplateBinding Minimum}"
                    HorizontalAlignment="Stretch" 
                    VerticalAlignment="Center"
                    Margin="0,0,2,0"
                    Style="{x:Null}"
                    x:Name="MySlider"/>
            <TextBox Grid.Column="1" Grid.Row="1"
                        Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource intToStringConverter}}"                     
                        HorizontalAlignment="Stretch" 
                        Margin="0,2,2,2" 
                        TextAlignment="Center" 
                        IsReadOnly="True"/>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="SliderLTB" TargetType="{x:Type Slider}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="55"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Slider Grid.Row="1"
                    Value="{Binding Value, RelativeSource={RelativeSource TemplatedParent}}"
                    Delay="{TemplateBinding Delay}"
                    Interval="{TemplateBinding Interval}"
                    IsEnabled="{TemplateBinding IsEnabled}"
                    LargeChange="{TemplateBinding LargeChange}"
                    Orientation="{TemplateBinding Orientation}"
                    SmallChange="{TemplateBinding SmallChange}"
                    TickFrequency="{TemplateBinding TickFrequency}"
                    TickPlacement="{TemplateBinding TickPlacement}"
                    Ticks="{TemplateBinding Ticks}"
                    ToolTip="{TemplateBinding ToolTip}"
                    Maximum="{TemplateBinding Maximum}"
                    Minimum="{TemplateBinding Minimum}"
                    HorizontalAlignment="Stretch" 
                    VerticalAlignment="Center"
                    Margin="0,0,2,0"
                    Style="{x:Null}"
                    x:Name="MySlider"/>
            <TextBox Grid.Column="1" Grid.Row="1"
                        Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}}" 
                        HorizontalAlignment="Stretch" 
                        Margin="0,2,2,2" 
                        TextAlignment="Center" 
                        IsReadOnly="True"/>
        </Grid>
    </ControlTemplate>
</ResourceDictionary>